package com.zxj.ds.mybatis.service;

import com.framework.msg.db.WeichatAccount;
import com.framework.msg.db.businessTransaction.OrderRecord;
import com.zxj.ds.mybatis.dao.saas2.DbSaas2Dao;
import com.zxj.ds.mybatis.dao.saas.DbSaasDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service
public class HelloService {
    @Autowired
    private DbSaasDao saasDao;
    @Autowired
    private DbSaas2Dao saas2Dao;
    public List<Map<String, Object>> getUsers() {
        List<Map<String, Object>> datas = saasDao.getUsers();
        return datas;
    }

    public List<OrderRecord> getOilOrder() {
        List<OrderRecord> d = saas2Dao.getOilOrder();
        return d;
    }

    public List<WeichatAccount> getAccounts() {
        return saasDao.getAccounts();
    }

    @Transactional
    public void b() {
/*        boolean r = saasDao.addApp("002","xxx");
        System.out.println(r);
        throw new RuntimeException("");*/

        boolean r = saas2Dao.addStaff("id1","xx");
        throw new RuntimeException("");

    }
}
